harden bounds checks and layout size validation in providers#627
Open
jmestwa-coder wants to merge 1 commit into
Open
harden bounds checks and layout size validation in providers#627jmestwa-coder wants to merge 1 commit into
jmestwa-coder wants to merge 1 commit into
Conversation
Author
|
any update? |
Collaborator
|
This was pretty similar to #626 but I didn't read it first, sorry. Maybe I slightly prefer the code style in this one, would you be able to redo against trunk? |
…aths - replace slotmem_size_mul/slotmem_size_add with a single slotmem_layout_sizes() helper so create/attach/store share one overflow-checked layout computation - store_slotmem: persist size was still computed unchecked; use the helper and drop the persist file on failure - slotmem_get/put: reject NULL buffers with nonzero length and skip the memcpy for zero length - slotmem_release (shm): log message read inuse[id] before the id bounds check; read it only when id is valid
jmestwa-coder
force-pushed
the
slotmem-harden-bounds-and-layout-safety
branch
from
July 18, 2026 08:59
f5f7ec6 to
167e87b
Compare
Author
|
Done, redone against trunk. Since r1936268 already covers most of the original patch, this is now just the delta:
Both files build warning-free with clang, and I checked the helper against the old formulas: identical sizes for all valid inputs, EINVAL for the shapes that used to wrap. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
slotmem: consolidate layout size checks and fix remaining unchecked paths
Redone against trunk now that r1936268 (#626) covers the create/attach/get/put checks. Remaining changes: